<html>
<head><meta charset="utf-8"><title>type inference issues with feature flags and `?` (?) · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/type.20inference.20issues.20with.20feature.20flags.20and.20.60.3F.60.20(.3F).html">type inference issues with feature flags and `?` (?)</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="244761491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/type%20inference%20issues%20with%20feature%20flags%20and%20%60%3F%60%20%28%3F%29/near/244761491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremiah Senkpiel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/type.20inference.20issues.20with.20feature.20flags.20and.20.60.3F.60.20(.3F).html#244761491">(Jul 02 2021 at 21:54)</a>:</h4>
<p>Anyone have any idea why this playground fails in the way it does? I really don't know what is going on. The try should not be inferring the error as Infallible since that flag is off, I would have thought. I honestly have no idea. (In case this seems silly, this is for the Surf http client, which can currently support multiple backend impls)</p>
<p><a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=ff8b7cb9c4912a2fe576a35508bdb388">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=ff8b7cb9c4912a2fe576a35508bdb388</a></p>



<a name="244761623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/type%20inference%20issues%20with%20feature%20flags%20and%20%60%3F%60%20%28%3F%29/near/244761623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/type.20inference.20issues.20with.20feature.20flags.20and.20.60.3F.60.20(.3F).html#244761623">(Jul 02 2021 at 21:56)</a>:</h4>
<p>It still gives the same compile error even when removing the impl with <code>#[cfg(feature="a")]</code>.</p>



<a name="244761735"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/type%20inference%20issues%20with%20feature%20flags%20and%20%60%3F%60%20%28%3F%29/near/244761735" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/type.20inference.20issues.20with.20feature.20flags.20and.20.60.3F.60.20(.3F).html#244761735">(Jul 02 2021 at 21:58)</a>:</h4>
<p>Replacing the <code>&lt;... as ...&gt;::Error</code> with <code>std::io::Error</code> makes it compile.</p>



<a name="244761966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/type%20inference%20issues%20with%20feature%20flags%20and%20%60%3F%60%20%28%3F%29/near/244761966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/type.20inference.20issues.20with.20feature.20flags.20and.20.60.3F.60.20(.3F).html#244761966">(Jul 02 2021 at 22:00)</a>:</h4>
<p><span class="user-mention" data-user-id="319552">@Jeremiah Senkpiel</span> Found the problem. You did DefaultClient TryFrom DefaultClient. This forwards to DefaultClient From DefaultClient and uses Infallible as error type. You should have used DefaultClient TryFrom HttpConfig. That fixes the issue.</p>



<a name="244762454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/type%20inference%20issues%20with%20feature%20flags%20and%20%60%3F%60%20%28%3F%29/near/244762454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremiah Senkpiel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/type.20inference.20issues.20with.20feature.20flags.20and.20.60.3F.60.20(.3F).html#244762454">(Jul 02 2021 at 22:06)</a>:</h4>
<p>ohhh, hah, thanks. Kinda glad it wasn't anything Intresting(tm)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>